# import os
# import qianfan
#
# # 设置参数
# os.environ["QIANFAN_ACCESS_KEY"] = "ALTAKERxgmerirNs9H2LO2PnHN"
# os.environ["QIANFAN_SECRET_KEY"] = "7665351191f24e92b31a9b7b4e7c48dc"
#
# chat_comp = qianfan.ChatCompletion()
#
#
# # 育种分析
# def breedingAnalysis(forecastBodySizeData):
#     # print(forecastBodySizeData)
#     forecastBodySizeData = {"体重": forecastBodySizeData[0][0][0], "体斜长": forecastBodySizeData[0][0][1],
#                             "颈长": forecastBodySizeData[0][0][2], "半潜水长": forecastBodySizeData[0][0][3],
#                             "龙骨长": forecastBodySizeData[0][0][4], "胸宽": forecastBodySizeData[0][0][5],
#                             "胸深": forecastBodySizeData[0][0][6], "胫长": forecastBodySizeData[0][0][7]}
#
#     content = f"你好，我这里有临武鸭的体尺信息，为：{forecastBodySizeData}，请根据这些体尺数据进行育种分析"
#     # 指定模型
#     resp = chat_comp.do(model="ERNIE-Speed-128K", messages=[{
#         "role": "user",
#         "content": content
#     }])
#
#     # print(resp["body"])
#     result = resp.get('body').get('result')
#     # print(result)
#     return result
#
#
# # 饲料配比
# def feedRatio(forecastBodySizeData):
#     # print(forecastBodySizeData)
#     forecastBodySizeData = {"体重": forecastBodySizeData[0][0][0], "体斜长": forecastBodySizeData[0][0][1],
#                             "颈长": forecastBodySizeData[0][0][2], "半潜水长": forecastBodySizeData[0][0][3],
#                             "龙骨长": forecastBodySizeData[0][0][4], "胸宽": forecastBodySizeData[0][0][5],
#                             "胸深": forecastBodySizeData[0][0][6], "胫长": forecastBodySizeData[0][0][7]}
#
#     content = f"你好，我这里有临武鸭的体尺信息，为：{forecastBodySizeData}，请根据这些体尺数据给出饲料配比"
#     # 指定模型
#     resp = chat_comp.do(model="ERNIE-Speed-128K", messages=[{
#         "role": "user",
#         "content": content
#     }])
#
#     # print(resp["body"])
#     result = resp.get('body').get('result')
#     print(result)
#
#     return result
